fix: Add integrations tests for browser and node#4390
Conversation
jeclrsg
left a comment
There was a problem hiding this comment.
A good chunk (maybe all) of that content in this instructions.md seems like it'd be useful to have under the "Developer Zone" heading of the repo's readme?
416e67d to
859ddc9
Compare
|
@jeclrsg - I let copilot redo the main readme and added some "integration" tests that checks the NodeJS CJS / ESM + Browser UMD / ESM loading... |
859ddc9 to
77364da
Compare
jeclrsg
left a comment
There was a problem hiding this comment.
@GordonSmith noticed a few formatting issues in the tests. also, the GH actions was noting some issues with a couple of timeouts on the beforeEach that were importing things
361e6e9 to
77c4a9e
Compare
09661de to
764f596
Compare
b00fdf5 to
dfdb6c3
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds integration tests for browser and Node.js environments for the @hpcc-js packages while also updating configuration files, documentation, and workflows to support multiple module formats. Key changes include:
- Addition of browser UMD and ESM test suites (including updated Vitest configs and tsconfig files) for the @hpcc-js/util, @hpcc-js/dataflow, and @hpcc-js/comms packages.
- Updates to package.json scripts and dependency declarations (including adjustments in the comms package) to support expanded testing.
- Enhancements to documentation (README files and GitHub workflow configuration) to clarify usage and integration testing.
Reviewed Changes
Copilot reviewed 20 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/browser-umd/.ts, tests/browser-esm/.ts | New test suites for both UMD and ESM browser environments |
| packages/markdown-it-plugins/tests/* | Minor path update in fetch() call |
| packages/comms/package.json | Dependency declarations updated (moved some deps into devDependencies) |
| package.json | Updated scripts (including uninstall command) and workspaces |
| README.md (root and tests/) | Extensive documentation updates for setup, testing, and usage |
| GitHub workflows (.github/workflows/release-please.yml) | Added extra test commands for browser and Node.js ESM/CJS tests |
| .github/instructions/general.instructions.md | New internal instructions for project standards and practices |
Comments suppressed due to low confidence (2)
packages/comms/package.json:89
- The dependencies d3-array, d3-format, d3-time-format, data-uri-to-buffer, safe-buffer, and tmp have been moved from dependencies to devDependencies. Please confirm that these modules are not required at runtime in production, as this change could lead to missing modules when the package is used.
"d3-array": "^1",
package.json:15
- The uninstall script now removes package-lock files and node_modules from several locations. Please verify that these removals are intentional and do not delete lock files that may be needed for proper dependency management in your environments.
"uninstall": "lerna clean && rimraf --glob packages/**/node_modules packages/**/package-lock.json demos/**/node_modules demos/**/package-lock.json tests/**/node_modules package-lock.json tests/**/package-lock.json node_modules",
jeclrsg
left a comment
There was a problem hiding this comment.
@GordonSmith noticed a few more nitpick formatting issues. And I don't understand those tests about "different types of exports"?
dfdb6c3 to
af4ceac
Compare
jeclrsg
left a comment
There was a problem hiding this comment.
@GordonSmith just one last nitpick where those test instances are missing whitespace between them
| expect(connection).toBeDefined(); | ||
| expect(wuService).toBeDefined(); | ||
| expect(dfuService).toBeDefined(); | ||
| }); it("should work in browser environment", async () => { |
There was a problem hiding this comment.
guess I missed it earlier, but last one of these I think?
Resolve minor export issues Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
af4ceac to
f09add9
Compare
Checklist:
Testing: